/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package gui.tools;

import database.DBConPool;
import gui.HuiMS;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.ImageIcon;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author Administrator
 */
public class 椅子控制台 extends javax.swing.JFrame {

    /**
     * Creates new form 锻造控制台
     */
    public 椅子控制台() {
        ImageIcon icon = new ImageIcon(getClass().getClassLoader().getResource("image2/logo.png"));
        setIconImage(icon.getImage());
        setTitle("椅子控制台");
        initComponents();
        刷新财神椅子();
        刷新泡澡浴桶();
        刷新椅子备注();
        刷新枫叶椅子();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        删除NPC = new javax.swing.JPanel();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel6 = new javax.swing.JPanel();
        jPanel7 = new javax.swing.JPanel();
        财神椅子金币上限 = new javax.swing.JTextField();
        财神椅子间隔 = new javax.swing.JTextField();
        jLabel249 = new javax.swing.JLabel();
        财神椅子叠加 = new javax.swing.JTextField();
        jLabel251 = new javax.swing.JLabel();
        财神椅子修改 = new javax.swing.JButton();
        jLabel262 = new javax.swing.JLabel();
        jPanel8 = new javax.swing.JPanel();
        浴桶间隔 = new javax.swing.JTextField();
        jLabel252 = new javax.swing.JLabel();
        jLabel254 = new javax.swing.JLabel();
        财神椅子修改1 = new javax.swing.JButton();
        浴桶经验1 = new javax.swing.JTextField();
        浴桶经验2 = new javax.swing.JTextField();
        浴桶经验3 = new javax.swing.JTextField();
        浴桶经验4 = new javax.swing.JTextField();
        浴桶经验5 = new javax.swing.JTextField();
        浴桶经验6 = new javax.swing.JTextField();
        浴桶经验7 = new javax.swing.JTextField();
        浴桶经验8 = new javax.swing.JTextField();
        浴桶经验9 = new javax.swing.JTextField();
        jLabel253 = new javax.swing.JLabel();
        jLabel255 = new javax.swing.JLabel();
        jLabel256 = new javax.swing.JLabel();
        jLabel257 = new javax.swing.JLabel();
        jLabel258 = new javax.swing.JLabel();
        jLabel260 = new javax.swing.JLabel();
        jLabel261 = new javax.swing.JLabel();
        jLabel263 = new javax.swing.JLabel();
        jLabel250 = new javax.swing.JLabel();
        jPanel37 = new javax.swing.JPanel();
        枫叶纪念凳金币 = new javax.swing.JTextField();
        枫叶纪念凳间隔 = new javax.swing.JTextField();
        jLabel315 = new javax.swing.JLabel();
        枫叶纪念凳经验 = new javax.swing.JTextField();
        jLabel317 = new javax.swing.JLabel();
        财神椅子修改2 = new javax.swing.JButton();
        jLabel318 = new javax.swing.JLabel();
        枫叶纪念凳人数 = new javax.swing.JTextField();
        jLabel322 = new javax.swing.JLabel();
        jPanel75 = new javax.swing.JPanel();
        jLabel326 = new javax.swing.JLabel();
        枫叶纪念凳备注 = new javax.swing.JTextField();
        jLabel327 = new javax.swing.JLabel();
        泡澡浴桶备注 = new javax.swing.JTextField();
        jLabel328 = new javax.swing.JLabel();
        财神椅子备注 = new javax.swing.JTextField();
        备注修改 = new javax.swing.JButton();

        setResizable(false);
        getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        删除NPC.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "椅子控制台", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.TOP, new java.awt.Font("幼圆", 0, 24))); // NOI18N
        删除NPC.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jPanel6.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
        jPanel6.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jPanel7.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "财神椅子", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.TOP, new java.awt.Font("幼圆", 0, 18))); // NOI18N
        jPanel7.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
        jPanel7.add(财神椅子金币上限, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 70, 120, 25));
        jPanel7.add(财神椅子间隔, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 150, 120, 25));

        jLabel249.setFont(new java.awt.Font("幼圆", 0, 14)); // NOI18N
        jLabel249.setText("每次叠加；");
        jPanel7.add(jLabel249, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 190, -1, 30));
        jPanel7.add(财神椅子叠加, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 220, 120, 25));

        jLabel251.setFont(new java.awt.Font("幼圆", 0, 14)); // NOI18N
        jLabel251.setText("获取间隔/分；");
        jPanel7.add(jLabel251, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 120, -1, 30));

        财神椅子修改.setText("修改");
        财神椅子修改.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                财神椅子修改ActionPerformed(evt);
            }
        });
        jPanel7.add(财神椅子修改, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 330, 120, 25));

        jLabel262.setFont(new java.awt.Font("幼圆", 0, 14)); // NOI18N
        jLabel262.setText("金币上限；");
        jPanel7.add(jLabel262, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 40, -1, 30));

        jPanel6.add(jPanel7, new org.netbeans.lib.awtextra.AbsoluteConstraints(660, 60, 270, 430));

        jPanel8.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "泡澡浴桶", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.TOP, new java.awt.Font("幼圆", 0, 18))); // NOI18N
        jPanel8.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
        jPanel8.add(浴桶间隔, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 70, 120, 25));

        jLabel252.setFont(new java.awt.Font("幼圆", 0, 14)); // NOI18N
        jLabel252.setText("61-80级；");
        jPanel8.add(jLabel252, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 280, -1, 30));

        jLabel254.setFont(new java.awt.Font("幼圆", 0, 14)); // NOI18N
        jLabel254.setText("获取间隔/分；");
        jPanel8.add(jLabel254, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 40, -1, 30));

        财神椅子修改1.setText("修改");
        财神椅子修改1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                财神椅子修改1ActionPerformed(evt);
            }
        });
        jPanel8.add(财神椅子修改1, new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 380, 120, 25));
        jPanel8.add(浴桶经验1, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 130, 120, 25));
        jPanel8.add(浴桶经验2, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 190, 120, 25));
        jPanel8.add(浴桶经验3, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 250, 120, 25));
        jPanel8.add(浴桶经验4, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 310, 120, 25));
        jPanel8.add(浴桶经验5, new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 70, 120, 25));
        jPanel8.add(浴桶经验6, new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 130, 120, 25));
        jPanel8.add(浴桶经验7, new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 190, 120, 25));
        jPanel8.add(浴桶经验8, new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 250, 120, 25));
        jPanel8.add(浴桶经验9, new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 310, 120, 25));

        jLabel253.setFont(new java.awt.Font("幼圆", 0, 14)); // NOI18N
        jLabel253.setText("161+；");
        jPanel8.add(jLabel253, new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 280, -1, 30));

        jLabel255.setFont(new java.awt.Font("幼圆", 0, 14)); // NOI18N
        jLabel255.setText("21-40级；");
        jPanel8.add(jLabel255, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 160, -1, 30));

        jLabel256.setFont(new java.awt.Font("幼圆", 0, 14)); // NOI18N
        jLabel256.setText("41-60级；");
        jPanel8.add(jLabel256, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 220, -1, 30));

        jLabel257.setFont(new java.awt.Font("幼圆", 0, 14)); // NOI18N
        jLabel257.setText("0-20级；");
        jPanel8.add(jLabel257, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 100, -1, 30));

        jLabel258.setFont(new java.awt.Font("幼圆", 0, 14)); // NOI18N
        jLabel258.setText("81-100级；");
        jPanel8.add(jLabel258, new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 40, -1, 30));

        jLabel260.setFont(new java.awt.Font("幼圆", 0, 14)); // NOI18N
        jLabel260.setText("101-120级；");
        jPanel8.add(jLabel260, new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 100, -1, 30));

        jLabel261.setFont(new java.awt.Font("幼圆", 0, 14)); // NOI18N
        jLabel261.setText("121-140级；");
        jPanel8.add(jLabel261, new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 160, -1, 30));

        jLabel263.setFont(new java.awt.Font("幼圆", 0, 14)); // NOI18N
        jLabel263.setText("141-160级；");
        jPanel8.add(jLabel263, new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 220, -1, 30));

        jPanel6.add(jPanel8, new org.netbeans.lib.awtextra.AbsoluteConstraints(290, 60, 340, 430));

        jLabel250.setFont(new java.awt.Font("幼圆", 0, 18)); // NOI18N
        jLabel250.setForeground(new java.awt.Color(255, 0, 51));
        jLabel250.setText("修改后，重启才可以生效。");
        jPanel6.add(jLabel250, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 20, 310, 30));

        jPanel37.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "枫叶纪念凳", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.TOP, new java.awt.Font("幼圆", 0, 18))); // NOI18N
        jPanel37.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
        jPanel37.add(枫叶纪念凳金币, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 70, 120, 25));
        jPanel37.add(枫叶纪念凳间隔, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 290, 120, 25));

        jLabel315.setFont(new java.awt.Font("幼圆", 0, 14)); // NOI18N
        jLabel315.setText("经验；");
        jPanel37.add(jLabel315, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 110, -1, 30));
        jPanel37.add(枫叶纪念凳经验, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 140, 120, 25));

        jLabel317.setFont(new java.awt.Font("幼圆", 0, 14)); // NOI18N
        jLabel317.setText("获取间隔/分；");
        jPanel37.add(jLabel317, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 260, -1, 30));

        财神椅子修改2.setText("修改");
        财神椅子修改2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                财神椅子修改2ActionPerformed(evt);
            }
        });
        jPanel37.add(财神椅子修改2, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 370, 120, 25));

        jLabel318.setFont(new java.awt.Font("幼圆", 0, 14)); // NOI18N
        jLabel318.setText("金币；");
        jPanel37.add(jLabel318, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 40, -1, 30));
        jPanel37.add(枫叶纪念凳人数, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 210, 120, 25));

        jLabel322.setFont(new java.awt.Font("幼圆", 0, 14)); // NOI18N
        jLabel322.setText("人数上限；");
        jPanel37.add(jLabel322, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 180, -1, 30));

        jPanel6.add(jPanel37, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 60, 220, 430));

        jTabbedPane1.addTab("第一页", jPanel6);

        jPanel75.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jLabel326.setFont(new java.awt.Font("幼圆", 0, 14)); // NOI18N
        jLabel326.setText("枫叶纪念凳备注；");
        jPanel75.add(jLabel326, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 30, -1, 30));
        jPanel75.add(枫叶纪念凳备注, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 60, 310, 25));

        jLabel327.setFont(new java.awt.Font("幼圆", 0, 14)); // NOI18N
        jLabel327.setText("泡澡浴桶备注；");
        jPanel75.add(jLabel327, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 100, -1, 30));
        jPanel75.add(泡澡浴桶备注, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 130, 310, 25));

        jLabel328.setFont(new java.awt.Font("幼圆", 0, 14)); // NOI18N
        jLabel328.setText("财神椅子备注；");
        jPanel75.add(jLabel328, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 170, -1, 30));
        jPanel75.add(财神椅子备注, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 200, 310, 25));

        备注修改.setText("修改");
        备注修改.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                备注修改ActionPerformed(evt);
            }
        });
        jPanel75.add(备注修改, new org.netbeans.lib.awtextra.AbsoluteConstraints(500, 60, 120, 25));

        jTabbedPane1.addTab("备注", jPanel75);

        删除NPC.add(jTabbedPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(15, 36, 950, 570));

        getContentPane().add(删除NPC, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 970, 610));

        pack();
        setLocationRelativeTo(null);
    }// </editor-fold>//GEN-END:initComponents

    private void 财神椅子修改ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_财神椅子修改ActionPerformed
        boolean result1 = this.财神椅子金币上限.getText().matches("[0-9]+");
        boolean result2 = this.财神椅子间隔.getText().matches("[0-9]+");
        boolean result3 = this.财神椅子叠加.getText().matches("[0-9]+");
        PreparedStatement ps = null;
        PreparedStatement ps1 = null;
        ResultSet rs = null;
        if (result1 && result2 && result3) {
            try (Connection con = DBConPool.getInstance().getDataSource().getConnection()) {
                ps = con.prepareStatement("UPDATE configvalues SET Val = ? WHERE id = ?");
                ps1 = con.prepareStatement("SELECT * FROM configvalues WHERE id = ?");
                ps1.setInt(1, 2302);
                rs = ps1.executeQuery();
                if (rs.next()) {
                    String sqlString2 = null;
                    sqlString2 = "update configvalues set Val='" + this.财神椅子金币上限.getText() + "' where id = 210000;";
                    PreparedStatement dropperid = con.prepareStatement(sqlString2);
                    dropperid.executeUpdate(sqlString2);

                    String sqlString3 = null;
                    sqlString3 = "update configvalues set Val='" + this.财神椅子间隔.getText() + "' where id = 210001;";
                    PreparedStatement dropperid3 = con.prepareStatement(sqlString3);
                    dropperid3.executeUpdate(sqlString3);

                    String sqlString4 = null;
                    sqlString4 = "update configvalues set Val='" + this.财神椅子叠加.getText() + "' where id = 210002;";
                    PreparedStatement dropperid4 = con.prepareStatement(sqlString4);
                    dropperid4.executeUpdate(sqlString4);
                    HuiMS.GetConfigValues();
                    刷新财神椅子();
                    JOptionPane.showMessageDialog(null, "修改成功");
                }
            } catch (SQLException ex) {
                Logger.getLogger(椅子控制台.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    }//GEN-LAST:event_财神椅子修改ActionPerformed

    private void 财神椅子修改1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_财神椅子修改1ActionPerformed
        boolean result0 = this.浴桶间隔.getText().matches("[0-9]+");
        boolean result1 = this.浴桶经验1.getText().matches("[0-9]+");
        boolean result2 = this.浴桶经验2.getText().matches("[0-9]+");
        boolean result3 = this.浴桶经验3.getText().matches("[0-9]+");
        boolean result4 = this.浴桶经验4.getText().matches("[0-9]+");
        boolean result5 = this.浴桶经验5.getText().matches("[0-9]+");
        boolean result6 = this.浴桶经验6.getText().matches("[0-9]+");
        boolean result7 = this.浴桶经验7.getText().matches("[0-9]+");
        boolean result8 = this.浴桶经验8.getText().matches("[0-9]+");
        boolean result9 = this.浴桶经验9.getText().matches("[0-9]+");
        PreparedStatement ps = null;
        PreparedStatement ps1 = null;
        ResultSet rs = null;
        if (result0 && result1 && result2 && result3 && result4 && result5 && result6 && result7 && result8 && result9) {
            try (Connection con = DBConPool.getInstance().getDataSource().getConnection()) {
                ps = con.prepareStatement("UPDATE configvalues SET Val = ? WHERE id = ?");
                ps1 = con.prepareStatement("SELECT * FROM configvalues WHERE id = ?");
                ps1.setInt(1, 2302);
                rs = ps1.executeQuery();
                if (rs.next()) {
                    String sqlString0 = null;
                    sqlString0 = "update configvalues set Val='" + this.浴桶间隔.getText() + "' where id = 210010;";
                    PreparedStatement dropperid0 = con.prepareStatement(sqlString0);
                    dropperid0.executeUpdate(sqlString0);

                    String sqlString1 = null;
                    sqlString1 = "update configvalues set Val='" + this.浴桶经验1.getText() + "' where id = 210011;";
                    PreparedStatement dropperid1 = con.prepareStatement(sqlString1);
                    dropperid1.executeUpdate(sqlString1);

                    String sqlString2 = null;
                    sqlString2 = "update configvalues set Val='" + this.浴桶经验2.getText() + "' where id = 210012;";
                    PreparedStatement dropperid = con.prepareStatement(sqlString2);
                    dropperid.executeUpdate(sqlString2);

                    String sqlString3 = null;
                    sqlString3 = "update configvalues set Val='" + this.浴桶经验3.getText() + "' where id = 210013;";
                    PreparedStatement dropperid3 = con.prepareStatement(sqlString3);
                    dropperid3.executeUpdate(sqlString3);

                    String sqlString4 = null;
                    sqlString4 = "update configvalues set Val='" + this.浴桶经验4.getText() + "' where id = 210014;";
                    PreparedStatement dropperid4 = con.prepareStatement(sqlString4);
                    dropperid4.executeUpdate(sqlString4);

                    String sqlString5 = null;
                    sqlString5 = "update configvalues set Val='" + this.浴桶经验5.getText() + "' where id = 210015;";
                    PreparedStatement dropperid5 = con.prepareStatement(sqlString5);
                    dropperid5.executeUpdate(sqlString5);

                    String sqlString6 = null;
                    sqlString6 = "update configvalues set Val='" + this.浴桶经验6.getText() + "' where id = 210016;";
                    PreparedStatement dropperid6 = con.prepareStatement(sqlString6);
                    dropperid6.executeUpdate(sqlString6);

                    String sqlString7 = null;
                    sqlString7 = "update configvalues set Val='" + this.浴桶经验7.getText() + "' where id = 210017;";
                    PreparedStatement dropperid7 = con.prepareStatement(sqlString7);
                    dropperid7.executeUpdate(sqlString7);

                    String sqlString8 = null;
                    sqlString8 = "update configvalues set Val='" + this.浴桶经验8.getText() + "' where id = 210018;";
                    PreparedStatement dropperid8 = con.prepareStatement(sqlString8);
                    dropperid8.executeUpdate(sqlString8);

                    String sqlString9 = null;
                    sqlString9 = "update configvalues set Val='" + this.浴桶经验9.getText() + "' where id = 210019;";
                    PreparedStatement dropperid9 = con.prepareStatement(sqlString9);
                    dropperid9.executeUpdate(sqlString9);

                    HuiMS.GetConfigValues();
                    刷新泡澡浴桶();
                    JOptionPane.showMessageDialog(null, "修改成功");
                }
            } catch (SQLException ex) {
                Logger.getLogger(椅子控制台.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    }//GEN-LAST:event_财神椅子修改1ActionPerformed

    private void 财神椅子修改2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_财神椅子修改2ActionPerformed
        PreparedStatement ps = null;
        PreparedStatement ps1 = null;
        ResultSet rs = null;
        boolean result1 = 枫叶纪念凳金币.getText().matches("[0-9]+");
        boolean result2 = 枫叶纪念凳经验.getText().matches("[0-9]+");
        boolean result3 = 枫叶纪念凳人数.getText().matches("[0-9]+");
        boolean result4 = 枫叶纪念凳间隔.getText().matches("[0-9]+");
        if (result1 && result2 && result3 && result4) {
            try (Connection con = DBConPool.getInstance().getDataSource().getConnection()) {
                ps = con.prepareStatement("SELECT * FROM configvalues ");
                rs = ps.executeQuery();
                if (rs.next()) {
                    String sqlString1 = null;
                    sqlString1 = "update configvalues set Val = '" + 枫叶纪念凳金币.getText() + "' where id = 210020;";
                    PreparedStatement Val = con.prepareStatement(sqlString1);
                    Val.executeUpdate(sqlString1);

                    String sqlString2 = null;
                    sqlString2 = "update configvalues set Val = '" + 枫叶纪念凳经验.getText() + "' where id = 210021;";
                    PreparedStatement Val2 = con.prepareStatement(sqlString2);
                    Val2.executeUpdate(sqlString2);

                    String sqlString3 = null;
                    sqlString3 = "update configvalues set Val = '" + 枫叶纪念凳人数.getText() + "' where id = 210022;";
                    PreparedStatement Val3 = con.prepareStatement(sqlString3);
                    Val3.executeUpdate(sqlString3);

                    String sqlString4 = null;
                    sqlString4 = "update configvalues set Val = '" + 枫叶纪念凳间隔.getText() + "' where id = 210023;";
                    PreparedStatement Val4 = con.prepareStatement(sqlString4);
                    Val4.executeUpdate(sqlString4);
                    HuiMS.GetConfigValues();
                    JOptionPane.showMessageDialog(null, "修改成功，已经生效");
                }
            } catch (SQLException ex) {
                Logger.getLogger(椅子控制台.class.getName()).log(Level.SEVERE, null, ex);
            }
        } else {
            JOptionPane.showMessageDialog(null, "？？？？？？？");
        }
    }//GEN-LAST:event_财神椅子修改2ActionPerformed

    private void 备注修改ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_备注修改ActionPerformed
        PreparedStatement ps = null;
        PreparedStatement ps1 = null;
        ResultSet rs = null;

        try (Connection con = DBConPool.getInstance().getDataSource().getConnection()) {
            ps = con.prepareStatement("SELECT * FROM qqstem ");
            rs = ps.executeQuery();
            if (rs.next()) {
                String sqlString1 = null;
                sqlString1 = "update qqstem set Name = '" + 枫叶纪念凳备注.getText() + "' where channel = 3010025;";
                PreparedStatement Val = con.prepareStatement(sqlString1);
                Val.executeUpdate(sqlString1);

                String sqlString2 = null;
                sqlString2 = "update qqstem set Name = '" + 泡澡浴桶备注.getText() + "' where channel = 3012002;";
                PreparedStatement Val2 = con.prepareStatement(sqlString2);
                Val2.executeUpdate(sqlString2);

                String sqlString3 = null;
                sqlString3 = "update qqstem set Name = '" + 财神椅子备注.getText() + "' where channel = 3010100;";
                PreparedStatement Val3 = con.prepareStatement(sqlString3);
                Val3.executeUpdate(sqlString3);
                刷新椅子备注();
                JOptionPane.showMessageDialog(null, "修改成功，已经生效");
            }
        } catch (SQLException ex) {
            Logger.getLogger(椅子控制台.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_备注修改ActionPerformed
    private void 刷新泡澡浴桶() {
        浴桶间隔.setText("" + gui.HuiMS.ConfigValuesMap.get("浴桶椅子0") + "");
        浴桶经验1.setText("" + gui.HuiMS.ConfigValuesMap.get("浴桶椅子1") + "");
        浴桶经验2.setText("" + gui.HuiMS.ConfigValuesMap.get("浴桶椅子2") + "");
        浴桶经验3.setText("" + gui.HuiMS.ConfigValuesMap.get("浴桶椅子3") + "");
        浴桶经验4.setText("" + gui.HuiMS.ConfigValuesMap.get("浴桶椅子4") + "");
        浴桶经验5.setText("" + gui.HuiMS.ConfigValuesMap.get("浴桶椅子5") + "");
        浴桶经验6.setText("" + gui.HuiMS.ConfigValuesMap.get("浴桶椅子6") + "");
        浴桶经验7.setText("" + gui.HuiMS.ConfigValuesMap.get("浴桶椅子7") + "");
        浴桶经验8.setText("" + gui.HuiMS.ConfigValuesMap.get("浴桶椅子8") + "");
        浴桶经验9.setText("" + gui.HuiMS.ConfigValuesMap.get("浴桶椅子9") + "");
    }

    private void 刷新财神椅子() {
        财神椅子金币上限.setText("" + gui.HuiMS.ConfigValuesMap.get("财神椅子1") + "");
        财神椅子间隔.setText("" + gui.HuiMS.ConfigValuesMap.get("财神椅子2") + "");
        财神椅子叠加.setText("" + gui.HuiMS.ConfigValuesMap.get("财神椅子3") + "");
    }

    private void 刷新椅子备注() {
        枫叶纪念凳备注.setText(取椅子备注(3010025));
        泡澡浴桶备注.setText(取椅子备注(3010100));
        财神椅子备注.setText(取椅子备注(3012002));
    }

    private void 刷新枫叶椅子() {
        枫叶纪念凳金币.setText("" + gui.HuiMS.ConfigValuesMap.get("枫叶纪念凳金币") + "");
        枫叶纪念凳经验.setText("" + gui.HuiMS.ConfigValuesMap.get("枫叶纪念凳经验") + "");
        枫叶纪念凳人数.setText("" + gui.HuiMS.ConfigValuesMap.get("枫叶纪念凳人数") + "");
        枫叶纪念凳间隔.setText("" + gui.HuiMS.ConfigValuesMap.get("枫叶纪念凳间隔") + "");
    }

    public static String 取椅子备注(int a) {
        String data = "";
        try (Connection con = DBConPool.getInstance().getDataSource().getConnection()) {
            PreparedStatement ps = con.prepareStatement("SELECT * FROM qqstem");
            ResultSet rs = ps.executeQuery();
            while (rs.next()) {
                if (rs.getInt("channel") == a) {
                    data = rs.getString("Name");
                }
            }
            ps.close();
        } catch (SQLException ex) {
        }
        return data;
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel249;
    private javax.swing.JLabel jLabel250;
    private javax.swing.JLabel jLabel251;
    private javax.swing.JLabel jLabel252;
    private javax.swing.JLabel jLabel253;
    private javax.swing.JLabel jLabel254;
    private javax.swing.JLabel jLabel255;
    private javax.swing.JLabel jLabel256;
    private javax.swing.JLabel jLabel257;
    private javax.swing.JLabel jLabel258;
    private javax.swing.JLabel jLabel260;
    private javax.swing.JLabel jLabel261;
    private javax.swing.JLabel jLabel262;
    private javax.swing.JLabel jLabel263;
    private javax.swing.JLabel jLabel315;
    private javax.swing.JLabel jLabel317;
    private javax.swing.JLabel jLabel318;
    private javax.swing.JLabel jLabel322;
    private javax.swing.JLabel jLabel326;
    private javax.swing.JLabel jLabel327;
    private javax.swing.JLabel jLabel328;
    private javax.swing.JPanel jPanel37;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel75;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JPanel 删除NPC;
    private javax.swing.JButton 备注修改;
    private javax.swing.JTextField 枫叶纪念凳人数;
    private javax.swing.JTextField 枫叶纪念凳备注;
    private javax.swing.JTextField 枫叶纪念凳经验;
    private javax.swing.JTextField 枫叶纪念凳金币;
    private javax.swing.JTextField 枫叶纪念凳间隔;
    private javax.swing.JTextField 泡澡浴桶备注;
    private javax.swing.JTextField 浴桶经验1;
    private javax.swing.JTextField 浴桶经验2;
    private javax.swing.JTextField 浴桶经验3;
    private javax.swing.JTextField 浴桶经验4;
    private javax.swing.JTextField 浴桶经验5;
    private javax.swing.JTextField 浴桶经验6;
    private javax.swing.JTextField 浴桶经验7;
    private javax.swing.JTextField 浴桶经验8;
    private javax.swing.JTextField 浴桶经验9;
    private javax.swing.JTextField 浴桶间隔;
    private javax.swing.JButton 财神椅子修改;
    private javax.swing.JButton 财神椅子修改1;
    private javax.swing.JButton 财神椅子修改2;
    private javax.swing.JTextField 财神椅子叠加;
    private javax.swing.JTextField 财神椅子备注;
    private javax.swing.JTextField 财神椅子金币上限;
    private javax.swing.JTextField 财神椅子间隔;
    // End of variables declaration//GEN-END:variables
}
